<template>
  <div class="warp __warp">
    <banner :value="banner" />
    <div class="content">
      <div class="content__left">
        <div class="item" v-for="item in note" :key="item.noteId">
          <note-item :value="item" />
        </div>
      </div>
      <div class="content__right">
        <content-right /> 
      </div>
    </div>
  </div>
</template>

<script>
import noteItem from "~/components/home/note_item";
import homeFloat from "~/components/home/home_float";
import banner from "../components/home/banner";
export default {
  components: {
    noteItem,
    homeFloat,
    banner,
  },
  async asyncData({ app }) {
    let data = await app.$axios.get("/api/get/hot/note", {
      params: {
        pageSize: 10,
        pageNo: 0,
      },
    });
    return {
      note: data.data.result,
    };
  },
  data() {
    return {
      note: [],
      hot: [],
      banner: [],
    };
  },
  mounted() {
    this.target("init");
  },
  methods: {
    target(key, data) {
      switch (key) {
        case "init":
 
          this.getBanner();
          break;
        default:
          break;
      }
    },
    async getBanner() {
      let data = await this.$axios.get("/api/get/banner/all", {
        params: {
          pageSize: 10,
          pageNo: 0,
        },
      });
      this.banner = data.data;
    },
  },
};
</script>

<style lang="scss" scoped >
.warp {
  padding-top: 30px;
  .content {
    display: flex;
    // align-items: center;
    margin-top: 30px;
    .content__left {
      width: 750px;
      margin-right: 30px;
      .item {
        background-color: white;
        margin-bottom: 40px;
      }
    }
    .content__right {
      flex: 1;
      
    }
  }
}
</style>
